using System;
using System.Collections.Generic;
using System.Linq;

namespace Drill.Configuration
{
	public class DependencyResolverConfigurationCollection
		: List<IDependencyResolverConfiguration>, IDependencyResolverConfigurationCollection
	{
		/// <summary>
		/// Gets the <see cref="IDependencyResolverConfiguration"/> with the specified key.
		/// </summary>
		/// <value>An instance of the <see cref="IDependencyResolverConfiguration"/> class.</value>
		public IDependencyResolverConfiguration this[string key]
		{
			get
			{
				return this.FirstOrDefault(item => 
						string.Compare(item.Name, key, StringComparison.OrdinalIgnoreCase) == 0
					);
			}
		}
	}
}